package org.filehanding.util;

import org.apache.commons.lang3.StringUtils;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * Created by liguo on 2016/5/15.
 */
public class PropertiesUtil {
    private static final ResourceBundle resource;

    static {
        resource = ResourceBundle.getBundle("setting", Locale.CHINESE);
    }

    private static String getResource(String key) {
        if (StringUtils.isEmpty(key)) {
            return StringUtils.EMPTY;
        }

        return resource.getString(key);
    }
    //取得文件上传路径
    public static String getFileUploadPath() {
        return getResource("file.upload.path");
    }

    //取得文件下载路径
    public static String getFileDownloadPath() {
        return getResource("file.download.path");
    }
}
